package com.lottery.ruok.lottrey.adapter;

import android.content.Context;
import android.view.View;

import com.applozic.mobicomkit.contact.AppContactService;
import com.lottery.ruok.lottrey.retrofitModule.response.GrabGiftHistoryResponse;
import com.lottery.ruok.lottrey.ui.component.GetRedPacketHistoryItemView;

import java.util.List;

/**
 * Created by ASUS on 2017/11/1.
 */

public class GetRedPacketHistoryAdapter extends BaseListAdapter<GrabGiftHistoryResponse.ListBean> {
    private AppContactService appContactService;

    public GetRedPacketHistoryAdapter(Context context, List<GrabGiftHistoryResponse.ListBean> list) {
        super(context, list);
        appContactService = new AppContactService(context);
    }


    @Override
    protected View createItemView(Context mContext) {
        return new GetRedPacketHistoryItemView(mContext);
    }

    @Override
    protected void onBindView(View itemView, int position) {
        if (itemView instanceof GetRedPacketHistoryItemView) {
            GetRedPacketHistoryItemView view = (GetRedPacketHistoryItemView) itemView;
            view.setData(appContactService, getList().get(position));
        }
    }


}